//
//  AXFMyOrederModel.m
//  AIXF
//
//  Created by zhanghui on 2017/7/10.
//  Copyright © 2017年 Macx. All rights reserved.
//

#import "AXFMyOrederModel.h"
#import "AXFOrderStatusModel.h"
#import "AXFOrderFeeModel.h"

@implementation AXFMyOrederModel

+ (NSDictionary *)modelContainerPropertyGenericClass {
    
    return @{
             
             @"order_goods" : [NSArray class],
             @"status_timeline" :[AXFOrderStatusModel class],
             @"fee_list" : [AXFOrderFeeModel class]
             
             };
}


- (BOOL)modelCustomTransformFromDictionary:(NSMutableDictionary *)dic {
    NSArray *goodsArray = dic[@"order_goods"];
    if (![goodsArray isKindOfClass:[NSArray class]]) return NO;
    
    __block NSMutableArray* result = [NSMutableArray arrayWithCapacity:goodsArray.count];
    
    [goodsArray enumerateObjectsUsingBlock:^(NSArray* obj, NSUInteger idx, BOOL * _Nonnull stop) {
        [result addObject:[NSArray yy_modelArrayWithClass:[AXFOrderGoodsModel class] json:obj]];
    }];
    
    _order_goods = result;
    
    return YES;
}

@end
